package my.jbf.firstGame.MODULE;
import java.util.*;
import android.util.*;
public class RandomID
{
	private final String allChar="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
	public String getRandomID(String kind,int TotalLength)
	{//生成指定长度为TotalLength的，开头为kink带冒号的字符串
		StringBuffer sb = new StringBuffer();
		Random random = new Random();
		sb.append(kind);
		sb.append(':');
		for (int i = sb.length(); i < TotalLength; i++) {
			sb.append(allChar.charAt(random.nextInt(allChar.length())));
		}
		return sb.toString();
	}
}

